﻿/*
* User.h
*
* 用户信息
*
* create date: 2014.4.11
* create by: leo
*
*/

#ifndef _USER_H_
#define _USER_H_

#include "cocos2d.h"
#include "../Common.h"
#include "../corps/BaseCorps.h"
#include "../scenes/BattleScene.h"

class CUser : public cocos2d::CCObject
{
public:
	static CUser& getInstance();

public:
	void login(cocos2d::CCObject* callbackObj, cocos2d::SEL_CallFunc loginSuccess);
	void logout();

	bool isLogin();

	void prepareEnterBattle(CBattleScene& scene);

protected:
	CUser();
	~CUser();

	void doNothing();

protected:
	CBaseCorps* mCorps; // 用户的队伍

	bool mLoggedIn;
	cocos2d::CCObject* mCallbackObj;
	cocos2d::SEL_CallFunc mOnLoginSuccess;

	int mID;
	cocos2d::CCString mName; // 玩家的名字
	int mLevel; // 玩家等级
	int mExp; // 经验

};

#endif // _USER_H_
